import Vue from "../node_modules/vue/dist/vue"
import VueRouter from "../node_modules/vue-router/dist/vue-router"
import loginForm from "./js/loginForm"
import registerForm from "./js/registerForm"

import './css/main.css'

//如果路由要模块化使用一定要全局声明

Vue.use(VueRouter)

// 创建VueRouter对象
const router = new VueRouter({
    routes:[ // 编写多个路由规则
        {
            path:"/login", // 请求路径
            component:loginForm // 组件名称
        },
        {
            path:"/register",
            component:registerForm
        },
    ]
})


let app = new Vue({
    el:"#app",
    components:{
        loginForm,
        registerForm
    },
    router // 引用上面定义的router对象
});
